const Router = require('koa-router');
const {verifyAuth} = require('../middleware/auth.middleware');
const {create, remove, update, list, verify, getSecretList} = require('../controller/secret.controller');

const secretRouter = new Router({prefix: "/secret"});

// 创建一个密保问题
secretRouter.post("/", verifyAuth, create);
// 删除一个密保问题
secretRouter.delete("/", verifyAuth, remove);
// 修改一个密保问题
secretRouter.patch("/", verifyAuth, update);
// 用户名返回密保
secretRouter.get("/", list);
// 验证密保答案是否正确
secretRouter.post("/verify", verify)
// 用户密保管理
secretRouter.get("/list", verifyAuth, getSecretList);

module.exports = secretRouter;
